package com.bsj.power.pls.service;

import com.bsj.power.common.config.global.JsonResult;
import com.bsj.power.common.def.dto.DeleteDTO;
import com.bsj.power.common.def.dto.TrackDTO;
import com.bsj.power.common.def.dto.cardReport.BindCardDTO;
import com.bsj.power.common.def.dto.locationDevice.LocationDevice2DDTO;
import com.bsj.power.common.def.dto.locationDevice.LocationDeviceDTO;
import com.bsj.power.common.def.dto.locationDevice.LocationDeviceSearchDTO;
import com.bsj.power.common.def.vo.*;
import com.bsj.power.common.def.vo.pls.Anchor2DInfoVO;
import com.bsj.power.common.def.vo.pls.AnchorDevice2DVO;
import com.bsj.power.common.def.vo.pls.LocationDeviceVO;
import com.bsj.power.common.def.vo.pls.PosInfoVO;
import com.bsj.power.common.def.vo.pls.excel.AnchorDeviceExcelVO;
import com.bsj.power.common.def.vo.pls.excel.LocationDeviceExcelVO;
import com.bsj.power.common.def.vo.pls.httpVo.HistoryOriginalVO;
import com.bsj.power.common.def.vo.tree.TreeStructureVO;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.text.ParseException;
import java.util.List;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description LocationDeviceService
 * @time 2024/4/19 11:17
 */
public interface LocationDeviceService {

    /**
     * 添加定位设备
     *
     * @param locationDeviceDTO
     * @return com.bsj.power.common.config.global.JsonResult
     * @author ljx
     * @time 2024/4/19 11:57
     */
    JsonResult addLocationDevice(LocationDeviceDTO locationDeviceDTO);

    /**
     * 删除定位设备
     *
     * @param deleteDTO
     * @return com.bsj.power.common.config.global.JsonResult
     * @author ljx
     * @time 2024/4/19 11:58
     */
    JsonResult deleteLocationDevice(DeleteDTO deleteDTO);

    /**
     * 修改定位设备
     *
     * @param locationDeviceDTO
     * @return com.bsj.power.common.config.global.JsonResult
     * @author ljx
     * @time 2024/4/19 11:58
     */
    JsonResult updateLocationDevice(LocationDeviceDTO locationDeviceDTO);

    /**
     * 获取单个定位设备
     *
     * @param deviceId
     * @return com.bsj.power.common.def.vo.pls.LocationDeviceVO
     * @author ljx
     * @time 2024/4/19 11:58
     */
    LocationDeviceVO getLocationDeviceById(Long deviceId);

    /**
     * 定位设备分页
     *
     * @param locationDeviceSearchDTO
     * @return com.bsj.power.common.config.global.JsonResult<java.util.List < com.bsj.power.common.def.vo.pls.LocationDeviceVO>>
     * @author ljx
     * @time 2024/4/19 11:58
     */
    JsonResult<List<LocationDeviceVO>> pageLocationDevice(LocationDeviceSearchDTO locationDeviceSearchDTO);

    /**
     * 是否绑定
     *
     * @param bindCardDTO
     * @param isRepetitionName 是否重名 1是  2否
     * @return com.bsj.power.common.config.global.JsonResult
     * @author ljx
     * @time 2024/5/8 17:10
     */
    JsonResult isBind(BindCardDTO bindCardDTO, Integer isRepetitionName);

    /**
     * 模糊搜索
     *
     * @param value
     * @param deviceType
     * @return java.util.List<com.bsj.power.common.def.vo.KeyValueVO>
     * @author ljx
     * @time 2024/5/15 16:10
     */
    List<KeyValueVO> fuzzySearch(String value, Integer deviceType);

    /**
     * 轨迹页面设备或人员模糊搜索
     *
     * @param value
     * @return
     */
    List<VagueVO> fuzzySearch2(String value);


    /**
     * 获取导出数据
     *
     * @param locationDeviceSearchDTO
     * @return java.util.List<com.bsj.power.common.def.vo.pls.excel.LocationDeviceExcelVO>
     * @author ljx
     * @time 2024/5/16 16:26
     */
    List<LocationDeviceExcelVO> getExportData(LocationDeviceSearchDTO locationDeviceSearchDTO);

    /**
     * 获取标签历史数据
     *
     * @return java.util.List<com.bsj.power.common.def.vo.pls.httpVo.HistoryOriginalVO>
     * @author ljx
     * @time 2024/5/25 9:47
     */
    List<HistoryOriginalVO> getTagHistoryData(TrackDTO trackDTO) throws ParseException;

//    /**
//     * 获取标签历史数据
//     *
//     * @param trackDTO
//     * @return java.util.List<com.bsj.power.common.def.vo.pls.httpVo.HistoryOriginalVO>
//     * @author ljx
//     * @time 2024/5/25 9:47
//     */
//    List<HistoryOriginalVO> getTagHistoryData2(TrackDTO trackDTO) throws ParseException;


    /**
     * 获取定位信息
     *
     * @param deviceName
     * @return com.bsj.power.common.def.vo.pls.PosInfoVO
     * @author ljx
     * @time 2024/6/5 12:05
     */
    PosInfoVO getPosInfo(String deviceName);

    /**
     * 查询指定工单某一时刻人员的最终位置
     *
     * @param time
     * @param jobId
     * @return
     */
    JsonResult getLastPosition(String time, Integer jobId);

    /**
     * 根据工号获取人员信息与工单信息
     *
     * @param empNo
     * @return com.bsj.power.common.def.vo.PersonAndJobVO
     * @author ljx
     * @time 2024/9/14 19:40
     */
    PersonAndJobVO getPersonAndJobInfo(String empNo);

    /**
     * 基站设备树结构
     *
     * @return java.util.List<com.bsj.power.common.def.vo.tree.TreeStructureVO>
     * @author ljx
     * @time 2024/10/7 11:38
     */
    List<TreeStructureVO> getTreeStructureVO();

    /**
     * 基站设备信息导出
     *
     * @param locationDeviceSearchDTO
     * @return java.util.List<com.bsj.power.common.def.vo.pls.excel.AnchorDeviceExcelVO>
     * @author ljx
     * @time 2024/10/24 16:35
     */
    List<AnchorDeviceExcelVO> getAnchorExportData(LocationDeviceSearchDTO locationDeviceSearchDTO);

    /**
     * 设置基站二维信息
     *
     * @param locationDevice2DDTOS
     * @return com.bsj.power.common.config.global.JsonResult
     * @author ljx
     * @time 2024/10/29 10:21
     */
    JsonResult setAnchor2DInfo(List<LocationDevice2DDTO> locationDevice2DDTOS);

    /**
     * 根据栋数和楼层查询基站设备二维信息
     *
     * @param building
     * @param floor
     * @return com.bsj.power.common.def.vo.pls.AnchorDevice2DVO
     * @author ljx
     * @time 2024/10/29 11:22
     */
    AnchorDevice2DVO listDevice2DInfo(Integer building, Integer floor);

    /**
     * 清除基站二维信息
     *
     * @param deviceNames
     * @return com.bsj.power.common.config.global.JsonResult
     * @author ljx
     * @time 2024/10/29 14:19
     */
    JsonResult cleanAnchor2DInfo(String[] deviceNames);

    /**
     * 设置设备别名
     *
     * @param file
     * @return com.bsj.power.common.config.global.JsonResult
     * @author ljx
     * @time 2024/10/29 16:07
     */
    JsonResult setNikeName(MultipartFile file) throws IOException;

    /**
     * 标签设备是否锁定
     *
     * @param deviceName 设备号
     * @param deviceName 是否锁定 1是 2否
     * @return com.bsj.power.common.config.global.JsonResult
     * @author ljx
     * @time 2024/12/6 10:50
     */
    JsonResult isLockIn(String deviceName, Integer isLockIn);

//    /**
//     * 根据人员身份证号获取人员id
//     * 请求海康“根据人员唯一字段获取人员详细信息”API
//     *
//     * @param idCardNo
//     * @return java.lang.String
//     * @author ljx
//     * @time 2024/9/25 11:43
//     */
//    String getExtEventPersonNoByIdCardNo(String idCardNo);
}
